/**
 *  Copyright 2010 ShenYang voole Co. Ltd.
 *  All right reserved. 
 */
package cn.piaoyi.dao;

import java.util.List;
import cn.piaoyi.bean.Goods;

/**
 * 功能描述:商品操作接口
 *
 * 创建日期 Apr 10, 2010
 *
 * @author zhangbaochao
 *
 * @version 1.0
 *
 */
public interface GoodsDAO {
	/**
	 * 保存Goods对象
	 * 
	 * @param goods
	 * 			Goods对象
	 * @return Goods
	 * 			Goods对象
	 */
	public Goods saveGoods(Goods goods);
	/**
	 * 保存或更新Goods对象
	 * 
	 * @param goods
	 * 			Goods对象
	 * @return Goods
	 * 			Goods对象
	 */
	public Goods saveOrUpdateGoods(Goods goods);
	/**
	 * 保存Goods对象
	 * 
	 * @param goods
	 * 			Goods对象
	 * @return Goods
	 * 			Goods对象
	 */
	public Goods updateGoods(Goods goods);
	
	/**
	 * 根据主键ID获取Goods对象
	 * 
	 * @param id
	 * 			主键ID
	 * @return Goods
	 * 			Goods对象
	 */
	public Goods findGoodsById(long id);
	
	
	/**
	 * 获取Goods对象个数
	 * 
	 * @param categoryId
	 * 			long
	 * @return long
	 * 			Goods对象个数
	 */
	public long getGoodsNum(int cityId,long categoryId,String name,int isShow,int state);
	
	public long getGoodsNum(int cityId,long categoryId,List ids,String name,int isShow,int state,int time,String startTime,String endTime);
	
	/**
	 * 获取Goods列表
	 * 
	 * @param categoryId
	 * 			long
	 * @param name
	 * 			String
	 * @param isShow
	 * 			int
	 * @param state
	 * 			int
	 * @param orderby
	 *            String
	 * @param ascOrDesc
	 *            int
	 * @param firstResult
	 *            int
	 * @param maxResults
	 *            int
	 * @return List
	 * 			Goods对象列表
	 */
	public List findGoodses(int cityId,long categoryId,String name,int isShow,int state,String orderby, int ascOrDesc, int firstResult, int maxResults);
	
	public List findGoodses(int cityId,long categoryId,List ids,String name,int isShow,int state,int time,String startTime,String endTime,String orderby,int ascOrDesc,int firstResult,int maxResults);
	
	/**
	 * 获取UserInfo列表
	 * 
	 * @param orderby
	 *            String
	 * @param ascOrDesc
	 *            int
	 * @return List
	 * 			Goods对象列表
	 */
	public List findGoodses(String orderby, int ascOrDesc);
	
	/**
	 * 删除Goods对象
	 */
	public void removeGoodsById(long id);
}
